﻿using System;
using System.Windows;
using System.Windows.Input;
using SocketioTest.View;
using SocketioTest.ViewModel;

namespace SocketioTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(this.MainWindow_Loaded);

        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this.DataContext = (object)MainWindowViewModel.GetInstance();
        }
        

        private void sendMsg_Click(object sender, RoutedEventArgs e)
        {
           
            //Socketa.SendMsgGroup(this.sendText.Text);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {

        }
        private void PageButtons(object sender, RoutedEventArgs e)
        {

        }

        private void ButtonPopUpLogout_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }

        private void GridTitle_MouseDown(object sender, MouseButtonEventArgs e)
        {
            DragMove();
        }


        /// <summary>
        /// 当用鼠标左键点击TopBorder控件时，触发此方法拖动
        /// (This method is triggered when the TopBorder control is clicked with the left mouse button)
        /// </summary>
        private void TopBorder_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            /* 当点击拖拽区域的时候，让窗口跟着移动
             (When clicking the drag area, make the window follow) */
            DragMove();
        }

    }
}
